#ifndef BOARD_H
#define BOARD_H

#include "Types.h"
#include "Bitboard.h"
using namespace Bitboards;

#define PIECEBB_SIZE 16

struct Board {
	Piece pieces[64];
	Bitboard piecesBB[PIECEBB_SIZE];
	Bitboard emptyBB;
	Bitboard occupiedBB;

	//Bitboard colorBB[2]; // could be part of pieceBB
};

extern void Board_init(Board & b_dest);
extern void	Board_init(Board & b_src, Board & b_dest);

extern void Board_Clear(Board & b_dest);
extern void Board_Clear(Board & b_dest, int square);
extern void Board_SetPiece(Board & b_dest, Piece piece, Square square);
extern Piece Board_GetPiece(Board & b_dest, Square square);
extern void Board_DoMove(Board & b_dest, Move move);
extern void Board_UndoMove(Board & b_dest, Move move, Piece piece, Piece cPiece);

extern bool Board_IsSquareEmpty(Board & b_dest, Square square);
extern bool Board_IsEqual(Board & b1, Board & b2);

extern int Board_Evaluate(Board & b);
extern void Board_DebugDisplay(Board & b);
extern char Board_PieceToChar(Piece p);
extern bool Board_IsCheck(Board & b, Color side);
extern bool Board_IsCheck(Board & b_dest, Square square, Color bySide);

extern bool Board_IsEmptyOrColor(Board & b_dest, Square square, Color bySide);

extern int Board_pawns_mobility(Board & b);
extern int Board_knights_mobility(Board & b);
extern int Board_bishops_mobility(Board & b);
extern int Board_rooks_mobility(Board & b);
extern int Board_queens_mobility(Board & b);
extern int Board_kings_mobility(Board & b);

#endif